﻿<form class="form-horizontal" action="@Url.Action("AjaxLogin", "Account")" method="post" id="loginForm">
    <div class="control-group">
        <label class="control-label" for="account">Tài khoản</label>
        <div class="controls">
            <input type="text" id="account" placeholder="Tài khoản của bạn" name="username" required />
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="password">Mật khẩu</label>
        <div class="controls">
            <input name="password" type="password" id="password" placeholder="Mật khẩu" required />
        </div>
    </div>
    <div class="control-group">
        <div class="controls">
            <button type="submit" class="btn">Đăng nhập</button>
            <a href="@Url.Action("GetPassword", "Account")">Quên mật khẩu?</a>
        </div>
    </div>
    <div class="control-group">
        <div class="controls">
            <a role="button" class="btn btn-primary" href="#"><i class="icon-large icon-facebook-sign"></i>Sử dụng tài khoản FaceBook</a>
        </div>
    </div>
</form>
<script>
    $(function () {
        $("#loginForm").submit(function () {
            $.ajax({
                url: this.action,
                type: "POST",
                data: $(this).serialize(),
                success: function (returnData) {
                    $("#loginModal").modal('hide');
                    window.location.reload();
                },
                error: function (t1, t2, t3) {
                    
                }
            });
            return false;
        });
    })
</script>

